#pragma once
#include "Value.h"
#include "event.h"
#include "agent.h"
#include "goal.h"
#include "role.h"


//#include "BasicObject.h"
//#include "event.h"
//#include <string>
//using namespace std;

namespace BAA
{

	class Event;
	typedef std::map<Agent*, std::vector<Goal*>>							AgentGoalsMap;


	class Appraisal:public BasicObject
	{
	public:
		Appraisal(const std::string name):BasicObject(name)
		{

		}

		~Appraisal()
		{

		}

		void Clear()
		{
			mConsequenceMap.clear();
			mTargetValuesMap.clear();
		}

		void Initialize(Agent * parent)
		{
			mParent = parent;
		}

		void AddValue(Value * value);

		void AddGoal(Goal * goal);

		void AddConsequenceWatch(std::string consequence,  Value * values);

		void AddTargetWatch( Agent* target, Value * value)
		{
			mTargetValuesMap[target]->push_back(value);
		}


		void AppraiseEvent(Event * event);

		float CalculateUtilityOfAction(Action* action);

		BAA::StringValuesMap* ConsequenceMap() { return &mConsequenceMap; }

		BAA::AgentValuesMap* TargetMap()  { return &mTargetValuesMap; }

	protected:

		Agent * mParent;
		// consequence map
		StringValuesMap  mConsequenceMap;

		// target map
		AgentValuesMap  mTargetValuesMap;

		AgentGoalsMap   mTargetGoalsMap;




	};// end class
}// end namespace
